package com.ljcalc.business.components;

import com.ljcalc.business.components.requests.HistoryResultRequest;
import com.ljcalc.business.components.requests.SSLHistoryResultRequest;

/**
 * this is comment
 * SSL stands for svenska spel lotto
 * @author SELuoc
 *
 */
public class SSLResultHistories extends ResultHistory {

	private static final String DEFAULT_PROPERTY_FILE_NAME = "result.histories";
	private static SSLResultHistories instance;
    
	private SSLResultHistories(String fn){
		super(DEFAULT_PROPERTY_FILE_NAME, fn);
	}
	
	public static SSLResultHistories getInstance(){
		if(instance==null){
			instance = new SSLResultHistories(null);
			HISTORY_TYPE = ResultHistory.SSL_TYPE;
		}
		return instance;
	}
	
	public static SSLResultHistories getInstance(String filename){
		if(instance==null){
			instance = new SSLResultHistories(filename);
		}
		return instance;
	}

    public HistoryResultRequest getResultInRequest(String key){
    	HistoryResultRequest hrr =  super.getResultInRequest(key);
		return new SSLHistoryResultRequest(hrr.getType(),hrr.getYear(),hrr.getRound());
    }

}
